package maman14;

import java.util.*;

public class RGBColorTester {
	
	public static void main(String ARGC[])
	{
		System.out.println("Welcome to The RGB Tester");
		
		RGBColor pix1 = new RGBColor(10,20,30);
		RGBColor pix2 = new RGBColor();
	//	pix1.
		pix2.setRed(55);
		
		printStatus(pix1,pix2);
		
		pix1.mix(pix2);
		
		System.out.println("no we mixed it..");
		
		printStatus(pix1,pix2);
		
		System.out.println("Now we invert pix1");
		pix1.invert();
		printStatus(pix1,pix2);
		
		System.out.println("Now we Calc GreyScale of it");
		System.out.println("The Greyscale of pix1:"+pix1+" is "+ roundToNum (2,pix1.convertToGrayScale()));
		//30% red + 59% green + 11% blue
		

		
		
	}
	
	
	public static void printStatus(RGBColor pix1,RGBColor pix2)
	{
		System.out.println("Pix1 is " + pix1);
		System.out.println("Pix2 is " + pix2);
		
	}
	
	public static double roundToNum(int zeros,double num)
	{
		double devider = Math.pow(10,zeros);
		int tempNum = (int) (num * devider) ;
		return tempNum / devider;
		
	}
	
	
	
}
